import Vue from 'vue'
import VueRouter from 'vue-router'

import Router from 'vue-router';
Vue.use(VueRouter)



const originalPush = Router.prototype.push

Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

const routes = [
  {
    path: '/Login',
    name: 'login',
    component: ()=>import('../views/LoginView.vue')
  },
  {
    path: '/Reg',
    name: 'Reg',
    component: ()=>import('../views/RegView.vue')
  },
  {
    path: '/',
    redirect: '/Login'
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/HomeView',
    name: 'HomeView',
    component: () => import('../views/HomeView.vue'),
    children: [
      {
        path: '/HomeView/DomainName',
        name: 'DomainName',
        component: () => import('../views/DataCollection/DomainName.vue')
      },
      {
        path: '/HomeView/KeywordSearch',
        name: 'KeywordSearch',
        component: () => import('../views/DataCollection/KeywordSearch.vue')
      },
      {
        path: '/HomeView/SupplierWeb',
        name: 'SupplierWeb',
        component: () => import('../views/DataCollection/KeywordsWeb.vue')
      },
      {
        path: '/HomeView/ThesisDatabase',
        name: 'ThesisDatabase',
        component: () => import('../views/DataCollection/ThesisDatabase.vue')
      },
      {
        path: '/HomeView/UserDefined',
        name: 'UserDefined',
        component: () => import('../views/DataCollection/UserDefined.vue')
      },
      {
        path: '/HomeView/SystemConfiguration',
        name: 'SystemConfiguration',
        component: () => import('../views/SystemControll/SystemConfiguration.vue')
      },
      {
        path: '/HomeView/DevConfiguration',
        name: 'DevConfiguration',
        component: () => import('../views/SystemControll/DevConfiguration.vue')
      },
      {
        path: '/HomeView/MonitorLog',
        name: 'MonitorLog',
        component: () => import('../views/SystemControll/MonitorLog.vue')
      },
      {
        path: '/HomeView/RoleEdit',
        name: 'RoleEdit',
        component: () => import('../views/UserManagement/RoleEdit.vue')
      },
      {
        path: '/HomeView/UserEdit',
        name: 'UserEdit',
        component: () => import('../views/UserManagement/UserEdit.vue')
      },
      {
        path: '/HomeView/ContentRetrieval/TextRetrieval',
        name: 'TextRetrieval',
        component: () => import('../views/ContentRetrieval/TextRetrieval.vue')
      },
      {
        path: '/HomeView/ContentRetrieval/ImageRetrieval',
        name: 'ImageRetrieval',
        component: () => import('../views/ContentRetrieval/ImageRetrieval.vue')
      },
      {
        path: '/HomeView/ResultExport/CollectTask',
        name: 'CollectTask',
        component: () => import('../views/ResultExport/CollectTask.vue')
      },
      {
        path: '/HomeView/ResultExport/CollectView',
        name: 'CollectView',
        component: () => import('../views/ResultExport/CollectView.vue')
      },
      {
        path: '/HomeView/ResultExport/RetrievalTask',
        name: 'RetrievalTask',
        component: () => import('../views/ResultExport/RetrievalTask.vue')
      },
      {
        path: '/HomeView/ResultExport/RetrievalView',
        name: 'RetrievalView',
        component: () => import('../views/ResultExport/RetrievalView.vue')
      },

    ]
  },
  {
    path: '/DataCollection/SupplierWebsite',
    name: 'SupplierWebsite',
    component: () => import('../views/DataCollection/KeywordsWeb.vue')
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
